home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / curveValues.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.9 KB  |  141 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //
  19. //  Alias|Wavefront Script File
  20. //  MODIFY THIS AT YOUR OWN RISK
  21. //
  22. //  Creation Date:  April 12 1996
  23. //  Author:         sspence
  24. //
  25. //  Description:
  26. //        These procs sets the state of controls in the property sheet.
  27. //        See also curveProperties.mel which constructs the property
  28. //        sheet.
  29. //
  30. //  Input Arguments:
  31. //      $toolName        - this is the name of the instance of the tool
  32. //                          that the property sheet is modifying.
  33. //
  34. //  Return Value:
  35. //      None.
  36. //
  37.  
  38. global proc curveValues ( string $toolName, string $type, string $ctxCmd ) {
  39. //
  40. //  Description:
  41. //        Sets the state of the property sheet based on the values
  42. //        in the tool context.
  43. //
  44.  
  45.     // set my top layout to be the current parent
  46.     //
  47.     string $parent = (`toolPropertyWindow -q -location` + "|" + $type );
  48.     setParent $parent;
  49.  
  50.     // set property sheet name and icon
  51.     //
  52.     string $icon;
  53.     string $helpTag;
  54.     if ($type == "curveCV") {
  55.         frameLayout -edit -l "CV Curve Settings" geometryOptions_F;
  56.         $icon = "curveCV.xpm";
  57.         checkBoxGrp -e -v1 `eval($ctxCmd + " -q -me " + $toolName)`  
  58.             curveCVMEKBox;
  59.         $helpTag = "CVCurveTool";
  60.     }
  61.     else if ($type == "curveSketch") {
  62.         frameLayout -edit -l "Pencil Curve Settings" geometryOptions_F;
  63.         $icon = "pencil.xpm";
  64.         $helpTag = "PencilCurveTool";
  65.     }
  66.     else if ($type == "curveEP") {
  67.         frameLayout -edit -l "EP Curve Settings" geometryOptions_F;
  68.         $icon = "curveEP.xpm";
  69.         $helpTag = "EPCurveTool";
  70.     }
  71.     toolPropertySetCommon $toolName $icon $helpTag;
  72.  
  73.     // select proper radio buttons for the degree
  74.     //
  75.     int $i = eval($ctxCmd + " -q -d " + $toolName);
  76.     if ($type == "curveSketch") {
  77.         switch ($i) {
  78.             case 1:
  79.                 radioButtonGrp -e -select 1  curveDegreeRadio1;
  80.                  break;
  81.             case 3:
  82.                 radioButtonGrp -e -select 2  curveDegreeRadio1;
  83.                  break;
  84.         }
  85.     }
  86.     else
  87.     {
  88.         switch ($i) {
  89.             case 1:
  90.                 radioButtonGrp -e -select 1  curveDegreeRadio1;
  91.                  break;
  92.             case 2:
  93.                 radioButtonGrp -e -select 2  curveDegreeRadio1;
  94.                  break;
  95.             case 3:
  96.                 radioButtonGrp -e -select 1  curveDegreeRadio2;
  97.                  break;
  98.             case 5:
  99.                 radioButtonGrp -e -select 2  curveDegreeRadio2;
  100.                  break;
  101.             case 7:
  102.                 radioButtonGrp -e -select 1  curveDegreeRadio3;
  103.                  break;
  104.         } 
  105.     }
  106.  
  107.     if ($type == "curveCV" || $type == "curveEP") {
  108.  
  109.         // Set knot parameterisation
  110.         //
  111.         int $isUniform = eval($ctxCmd + " -q -un " + $toolName);
  112.         if ( $isUniform ) { 
  113.             radioButtonGrp -e -select 1 curveKnotTypeRadio1;
  114.         }
  115.         else { 
  116.             radioButtonGrp -e -select 2 curveKnotTypeRadio1;
  117.         }
  118.     }
  119.  
  120. /*
  121.     if ($type == "curveEP") {
  122.  
  123.         // Set shape behaviour
  124.         //
  125.         int $isPreserveShape = eval($ctxCmd + " -q -ps " + $toolName);
  126.         if ( $isPreserveShape ) { 
  127.             radioButtonGrp -e -select 1 curveShapeTypeRadio1;
  128.         }
  129.         else { 
  130.             radioButtonGrp -e -select 2 curveShapeTypeRadio1;
  131.         }
  132.  
  133.         // Set editing shape behaviour
  134.         //
  135.         floatSliderGrp -e -v `eval($ctxCmd + " -q -pf " + $toolName)` 
  136.             fractionSlider;
  137.     }
  138. */
  139.     toolPropertySelect $type;
  140. }
  141.